/*
 * socketInterface.h
 *
 *  Created on: 11/12/2012
 *      Author: Julian Ovalle
 */

#ifndef SOCKETINTERFACE_H_
#define SOCKETINTERFACE_H_

#include <sys/types.h>
#include <sys/socket.h>

//#define SOCK_INTERFACE_DEBUG

//int openSocket(struct sockaddr localName, struct sockaddr remoteName, socklen_t remote_name_size);
int openSocket(struct sockaddr_in *remoteName);

int socketSend(int sfd, const void* data, size_t size, struct sockaddr* addr,
        socklen_t addrlen, int timeout_s, int timeout_ms);

int socketReceive(int sfd, const void* buf, size_t size, struct sockaddr* addr,
        socklen_t* addrlen, int timeout_s, int timeout_ms);

void flushSocket (int s);

#endif /* SOCKETINTERFACE_H_ */
